package Animal;
//Test.java
public class Test {
    void eat(Animal a){
        a.eat();
    }

    public static void main(String[] args) {
        Cat cat = new Cat("小猫");
        Dog dog = new Dog("小狗");
        cat.eat();
        dog.eat();
    }
}
//输出结果
//小猫吃猫粮
//小狗吃狗粮